@model EIMS.Models.Employee

@{
    ViewData["Title"] = "新增员工";
}

<div class="container-fluid px-4">
    <h1 class="mt-4">@ViewData["Title"]</h1>
    <ol class="breadcrumb mb-4">
        <li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index">首页</a></li>
        <li class="breadcrumb-item"><a asp-controller="Employees" asp-action="Index">员工管理</a></li>
        <li class="breadcrumb-item active">新增员工</li>
    </ol>
    
    <div class="card mb-4">
        <div class="card-header">
            <i class="fas fa-user-plus me-1"></i>
            填写员工信息
        </div>
        <div class="card-body">
            <form asp-action="Create" method="post">
                <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="EmployeeNumber" class="control-label"></label>
                            <input asp-for="EmployeeNumber" class="form-control" />
                            <span asp-validation-for="EmployeeNumber" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Name" class="control-label"></label>
                            <input asp-for="Name" class="form-control" />
                            <span asp-validation-for="Name" class="text-danger"></span>
                        </div>
                    </div>
                </div>
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Gender" class="control-label"></label>
                            <select asp-for="Gender" asp-items="Html.GetEnumSelectList<EIMS.Models.Enums.Gender>()" class="form-select"></select>
                            <span asp-validation-for="Gender" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="DateOfBirth" class="control-label"></label>
                            <input asp-for="DateOfBirth" class="form-control" type="date" />
                            <span asp-validation-for="DateOfBirth" class="text-danger"></span>
                        </div>
                    </div>
                </div>
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="PhoneNumber" class="control-label"></label>
                            <input asp-for="PhoneNumber" class="form-control" />
                            <span asp-validation-for="PhoneNumber" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Email" class="control-label"></label>
                            <input asp-for="Email" class="form-control" />
                            <span asp-validation-for="Email" class="text-danger"></span>
                        </div>
                    </div>
                </div>
                
                <div class="row mb-3">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label asp-for="Address" class="control-label"></label>
                            <textarea asp-for="Address" class="form-control" rows="2"></textarea>
                            <span asp-validation-for="Address" class="text-danger"></span>
                        </div>
                    </div>
                </div>
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="HireDate" class="control-label"></label>
                            <input asp-for="HireDate" class="form-control" type="date" value="@DateTime.Now.ToString("yyyy-MM-dd")" />
                            <span asp-validation-for="HireDate" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="DepartmentId" class="control-label"></label>
                            <select asp-for="DepartmentId" class="form-select" asp-items="ViewBag.DepartmentId">
                                <option value="">-- 请选择部门 --</option>
                            </select>
                            <span asp-validation-for="DepartmentId" class="text-danger"></span>
                        </div>
                    </div>
                </div>
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Status" class="control-label"></label>
                            <select asp-for="Status" asp-items="Html.GetEnumSelectList<EIMS.Models.Enums.EmployeeStatus>()" class="form-select"></select>
                            <span asp-validation-for="Status" class="text-danger"></span>
                        </div>
                    </div>
                </div>
                
                <div class="form-group">
                    <a asp-action="Index" class="btn btn-secondary">返回列表</a>
                    <button type="submit" class="btn btn-primary">
                        <i class="fas fa-save me-1"></i> 保存
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
} 